import request from '@/utils/request'

// 查询RawProductDetail列表
export function listRawProductDetail(query) {
  return request({
    url: '/RawProductDetail/list',
    method: 'get',
    params: query
  })
}

// 查询RawProductDetail详细
export function getRawProductDetail(rawProductCode) {
  return request({
    url: '/RawProductDetail/' + rawProductCode,
    method: 'get'
  })
}

// 新增RawProductDetail
export function addRawProductDetail(data) {
  return request({
    url: '/RawProductDetail',
    method: 'post',
    data: data
  })
}

// 修改RawProductDetail
export function updateRawProductDetail(data) {
  return request({
    url: '/RawProductDetail',
    method: 'put',
    data: data
  })
}

// 删除RawProductDetail
export function delRawProductDetail(rawProductCode) {
  return request({
    url: '/RawProductDetail/' + rawProductCode,
    method: 'delete'
  })
}

//通过订单编号查询货品对应的剩余调拨数量
export function getRemainAllocationQuantityByOrderNo(orderNo) {
  return request({
    url: '/RawProductDetail/remain/allocation/quantity',
    method: 'post',
    data: orderNo
  })
}

//通过订单编号获取所有货品详细信息
export function getRawProductDetailByOrderNo(orderNo) {
  return request({
    url: '/RawProductDetail/list/orderNo',
    method: 'post',
    data: orderNo
  })
}
